/*
 * @Author: '137' '1432417996@qq.com'
 * @Date: 2025-03-25 02:26:25
 * @LastEditors: 137 '1432417996@qq.com'
 * @LastEditTime: 2025-04-28 22:18:58
 * @FilePath: \starter-3\api\user.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { request } from '@/api/request'

// 查看我的活动列表
export function getMyActivities(data) {
    return request({
        url: '/my/activities',
        method: 'post',
        data
    })
}

// 修改密码
export function changePassword(data) {
    return request({
        url: '/my/change-password',
        method: 'post',
        data
    })
}

// 获取用户是否注册密码
export function getUserPassword() {
    return request({
        url: '/my/has-password',
        method: 'get',
    })
}


// 获取用户信息
export function getMyInfo() {
    return request({
        url: '/my/info',
        method: 'get',
    })
}

// 修改用户信息
export function updateMyInfoEdit(data) {
    return request({
        url: '/my/info/edit',
        method: 'post',
        data
    })
}

// 添加导航栏
export function addNav(data) {
    return request({
        url:  `/my/nav/add`,
        method: 'post',
        data
    })
}

// 批量排序
export function batchSort(data) {
    return request({
        url:  `/my/nav/batch-sort`,
        method: 'post',
        data
    })
}

// 删除导航栏
export function deleteNav(navId) {
    return request({
        url:  `/my/nav/delete/${navId}`,
        method: 'delete',
    })
}

// 获取导航栏列表
export function getNavList() {
    return request({
        url:  `/my/nav/list`,
        method: 'get',
    })
}

// 修改导航栏
export function updateNav(data) {
    return request({
        url:  `/my/nav/update/${data.id}`,
        method: 'put',
        data
    })
}

// 修改用户名
export function updateUserName(data) {
    return request({
        url:  `/my/username/edit`,
        method: 'post',
        data
    })
}

// 绑定微信
export function bindWechat(data) {
    return request({
        url:  `/my/wechat/bind`,
        method: 'post',
        data
    })
}

// 获取微信绑定链接
export function getWechatBindUrl() {
    return request({
        url:  `/my/wechat/bind-url`,
        method: 'get',
    })
}

// 解绑微信
export function unbindWechat(data) {
    return request({
        url:  `/my/wechat/unbind`,
        method: 'post',
        data
    })
}
